-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tso: skip resetting leader when resetting tso allocator #8495
Conversation
Signed-off-by: Ryan Leung <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8495 +/- ##
=======================================
Coverage 77.35% 77.35%
=======================================
Files 472 472
Lines 61782 61798 +16
=======================================
+ Hits 47789 47805 +16
+ Misses 10432 10431 -1
- Partials 3561 3562 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -1132,13 +1132,13 @@ func (am *AllocatorManager) HandleRequest(ctx context.Context, dcLocation string | |||
|
|||
// ResetAllocatorGroup will reset the allocator's leadership and TSO initialized in memory. | |||
// It usually should be called before re-triggering an Allocator leader campaign. | |||
func (am *AllocatorManager) ResetAllocatorGroup(dcLocation string) { | |||
func (am *AllocatorManager) ResetAllocatorGroup(dcLocation string, skipResetLeader bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is skipResetLeader true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add a PR description.
pkg/keyspace/tso_keyspace_group.go
Outdated
@@ -181,6 +181,9 @@ func (m *GroupManager) allocNodesToAllKeyspaceGroups(ctx context.Context) { | |||
log.Info("the raftcluster is closed, stop to alloc nodes to all keyspace groups") | |||
return | |||
case <-ticker.C: | |||
if m.nodesBalancer.Len() == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetNodesCount()
is better
Signed-off-by: Ryan Leung <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lhy1024, okJiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@rleungx: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: Ref #8477.
What is changed and how does it work?
This PR supports skipping resetting the leadership when resetting the TSO allocator which will be used in the next PR. The PD might reset the TSO allocator leader and let the TSO service serve TSO requests. In this case, the PD leader should not be affected.
Check List
Tests
Release note